// pages/doctorhomepage/diseaseinput/diseaseinput.js
var app=getApp()
Page({
  data: {

  },
  onLoad: function (options) {

  },
  onShareAppMessage: function () {
  },
  formSubmit: function (e) {
    var that = this
    console.log('form发生了submit事件，携带数据为：', e.detail.value);
    var objDate = e.detail.value;
    if (objDate.patientname && objDate.status && objDate.time) {
      wx.setStorage({
        key: 'patientname',
        data: objDate.patientname,
      })
      wx.setStorage({
        key: 'status',
        data: objDate.status,
      })
      wx.setStorage({
        key: 'time',
        data: objDate.time,
      })

      wx.request({
        url: app.globalData.url + '/API/diseaseinput',
        data: {
          'patientname': e.detail.value.patientname,
          'status': e.detail.value.status,
          'time': e.detail.value.time,
        },
        method: 'get',
        header: {
          'content-type': 'application/json'
        },
        success: function (res) {
          console.log(res.data)
        }
      })
      wx.showModal({
        title: '提示',
        content: '上传成功',
        showCancel: false
      })
    }
  },
  formReset: function () {
    console.log('form发生了reset事件')
  },
})